package com.lantosec.hmrp.modules.sysdata.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.sysdata.vo.SysModelFormVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * <p>
 * 流程模型与表单的关系表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SysModelForm extends BaseEntity<SysModelFormVO> {
    private static final long serialVersionUID = 1L;

    public SysModelForm(SysModelFormVO vo){
        this.modelFormId = vo.getModelFormId();
        this.processName = vo.getProcessName();
        this.processType = vo.getProcessType();
        this.modelId = vo.getModelId();
        this.formTableId = vo.getFormTableId();
        this.startLayoutId = vo.getFormTableId();
        this.startTaskId = vo.getStartTaskId();
        this.createTime = vo.getCreateTime();
        this.editTime = vo.getEditTime();
        this.flag = vo.getFlag();
        this.proInsNameRule = vo.getProInsNameRule();
    }

    @Override
    public SysModelFormVO convertToVO(){
        return new SysModelFormVO(this);
    }


    /**
     * ID
     */
    @TableId(value = "model_form_id", type = IdType.ASSIGN_UUID)
    private String modelFormId;

    /**
     * 流程模型名称
     */
    private String processName;

    /**
     * 流程分类，对应数据字典表ID
     */
    private String processType;

    /**
     * Flowable中act_re_model中对应的ID
     */
    private String modelId;

    /**
     * form_table中对应的ID
     */
    private String formTableId;

    /**
     * form_layout中对应的ID
     */
    private String startLayoutId;

    /**
     * 流程开始任务节点Id
     */
    private String startTaskId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 最后编辑时间
     */
    private Date editTime;

    /**
     * 逻辑删除标识
     */
    private int flag;

    /**
     * 流程实例名称规则
     */
    private String proInsNameRule;


    public enum ColName {
        process_form_id, process_name, process_type, model_id, form_table_id, start_layout_id, create_time, edit_time, flag,pro_ins_name_rule
    }
}
